#define _CRT_SECURE_NO_WARNINGS 2

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<string.h>
#include<assert.h>

typedef char datatype;
//typedef BTNode* pNode;

typedef struct BTNode {
	struct BTNode* left;
	struct BTNode* right;
	datatype val;
}*pBTNode,BTNode;

typedef struct Node {
	struct Node* next;
	pBTNode val;
}Node;

typedef struct Queue {
	Node* front;
	 Node* rear;
	int size;
}Queue;

BTNode* BinaryTreeCreate(datatype* a, int n, int* pi);
void PreOrder(BTNode* root);
void BinaryTreeDestory(BTNode** root);
int BinaryTreeSize(BTNode* root);
int BinaryTreeLevelKSize(BTNode* root, int k);
BTNode* BinaryTreeFind(BTNode* root, datatype x);
int BinaryTreeLeafSize(BTNode* root);
void BinaryTreeLevelOrder(BTNode* root);
int  maxDepth(BTNode* root);
int BinaryTreeComplete(BTNode* root);